const { defineConfig } = require('@vue/cli-service')
const Mock = require('mockjs')
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  devServer: {
    onAfterSetupMiddleware(server) {
      server.app.get('/get_home_arr', (req, res) => {
        let getarr = Mock.mock({
          "arr|5": [{
            id: "@id",
            title: "@ctitle(3,5)",
            img: "@image(300x200,@color)"
          }]
        })
        res.json(getarr)
      })
      server.app.get('/get_class_arr', (req, res) => {
        let getarr = Mock.mock({
          "arr|4": [{
            title: "@ctitle(3,5)",
            "list|10": [{
              id: "@id",
              title: "@ctitle(3,5)",
              img: "@image(80x80,@color)"
            }]
          }]
        })
        res.json(getarr)
      })
    }
  }
})
